package us.gaaoc.framework.dao;

import java.util.List;

import org.hibernate.Query;

import us.gaaoc.framework.model.CaseRecord;
import us.gaaoc.framework.model.OrgParticipants;



/**
 * Home object for domain model class Participants.
 * @see us.gaaoc.framework.Participants
 * @author Hibernate Tools
 */
public class OrgParticipantsDAOHibernate  extends GenericHibernateDAO<OrgParticipants, String, OrgParticipantsDAO>
implements  OrgParticipantsDAO{

	protected OrgParticipantsDAOHibernate() {}
	
	/**
	 * get the initiating organization
	 * @param caseRecord
	 * @return the initiating party organization
	 */
	
	public List<OrgParticipants> getOrgParticipantInitiatingParty(CaseRecord caseRecord) {
		Query q = this.getSession().createQuery("from OrgParticipants pp where pp.relationship.code = 1 and pp.caseRecord.uuid = ?");
		q.setString(0, caseRecord.getUuid());			
		return q.list();
	}
}